const fs = require('fs')
fs.readFile('src/display.css','utf-8',(e,d) => {
    if(e) throw e;
    newData = d.replace(/\s+/g,'').replace(/\/\*[\s\S]*\*\//g,'')
    if (fs.existsSync('dist')){
        fs.writeFile('dist/display.min.css',newData,(e) => {
            if(e) throw e;
            fs.unlink('src/display.css', (e) => {
                if (e) throw e;
            })
        })
    } else {
        fs.mkdirSync('dist');
        fs.writeFile('dist/display.min.css',newData,(e) => {
            if(e) throw e;
            fs.unlink('src/display.css', (e) => {
                if (e) throw e;
            })
        })
    } 

})